home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 2000 July / macformat-092.iso / Fireworks 3 / Settings / Commands / Animation / Rotate and Scale.jsf next >
Encoding:
Text File  |  1999-11-19  |  950 b   |  29 lines

  1. // Copyright (c) 1999 Macromedia. All rights reserved.
  2.  
  3. // Tell the user what is going to happen
  4. var message = confirm("This command creates a multi-frame animation by rotating and scaling the objects in the document.");
  5.  
  6. if (message == true)
  7. {
  8.     // Add frames for the animation
  9.     var kNumFrames = 12;
  10.  
  11.     fw.getDocumentDOM().addFrames(kNumFrames, "after current");
  12.     fw.getDocumentDOM().selectAll();
  13.     fw.getDocumentDOM().duplicateSelectionToFrames("all");
  14.  
  15.     var angle = 30;
  16.     var scale = 1 - 0.083;
  17.     for (frameNum = 1; frameNum <= kNumFrames; frameNum++) {
  18.         fw.getDocumentDOM().currentFrameNum = frameNum;
  19.         fw.getDocumentDOM().selectAll();
  20.         fw.getDocumentDOM().scaleSelection(scale, scale, "autoTrimImages transformAttributes");
  21.         fw.getDocumentDOM().rotateSelection(angle, "autoTrimImages transformAttributes");
  22.         scale -= 0.083;
  23.         angle += 30;
  24.     }
  25.  
  26.     // Set the export options
  27.     fw.getDocumentDOM().setExportOptions({ exportFormat:"GIF animation" });
  28. }
  29.